import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'

/**
 * 分页查询采集站
 * @param param
 * @returns {*}
 */
export const queryPage = (param) => {
  return axios.request({
    url: '/admin/site/query/page/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}
/**
 * 新增采集站
 */
export const addSite = (param) => {
  return axios.request({
    url: '/admin/site/add/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}
/**
 * 修改采集站
 * @param param
 * @returns {*}
 */
export const updateSite = (param) => {
  return axios.request({
    url: '/admin/site/update/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}
/**
 * 删除采集站
 * @param param
 * @returns {*}
 */
export const removeSite = (param) => {
  return axios.request({
    url: '/admin/site/delete/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}
